-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Fix IndexStatsIT#testThrottleStats
#128049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
`Engine.PauseLock#throttle` can be called when the lock is being throttled, so we can't guarantee that all permits are available before throttling. Resolve elastic#126359 See elastic#127173
Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing) |
Hi Artem, sorry for taking so long to get to this. I am not convinced this is the right fix. We do not call But I am not sure yet where the mismatch might be caused. |
I believe there is a race condition between |
This makes sense to me too, I think the test could be rewritten to use those handles and provoke the issue. I agree the fix needs to be done differently, we might need to have a lock inside activeate/deactivateThrottling (though other solutions can be done too, but seems more complex and this should not be a heavily called mechanism). |
But the elasticsearch/server/src/main/java/org/elasticsearch/index/engine/ThreadPoolMergeScheduler.java Line 251 in b909a50
IndexThrottle#activate -> IndexThrottle#deactivate -> IndexThrottle#activate where some IndexThrottle#acquireThrottle from the first activate haven't released yet, before the second one. If that's the case, I believe Artem's fix proposal, to remove the assert, should fix this test failure (but I don't think that the added test exercises the fault here).
|
Engine.PauseLock#throttle
can be called when the lock is being throttled, so we can't guarantee that all permits are available before throttling.Resolve #126359
See #127173